
import request from './network.js'

export function getDetail(iid){
  return request({
    url:'/detail',
    data:{
      iid
    }
  })
}
export class goodsBaseInfo{
  constructor(itemInfo, columns, services){
    this.title = itemInfo.title,
    this.desc = itemInfo.desc,
    this.newPrice = itemInfo.lowNowPrice,
    this.oldPrice = itemInfo.oldPrice,
    this.disCount = itemInfo.discountDesc,
    this.columns = columns,
    this.services = services
  }
}

export class ShopInfo{
  constructor(shopInfo){
    this.logo = shopInfo.shopLogo;
    this.name = shopInfo.name;
    this.fans = shopInfo.cFans;
    this.sells = shopInfo.cSells;
    this.score = shopInfo.score;
    this.goodsCount = shopInfo.cGoods
  }
}
export class ParamsInfo{
  constructor(info,rule){
    this.image = info.images?info.images[0]:'';
    this.infos = info.set;
    this.size = rule.tables
  }
}
// 获取商品推荐数据
export function getrecommendsdata(){
  return request({
    url:'/recommend'
  })
}